import Vue from "vue";
import tips from "./tips.vue"; // 引入弹窗组件

const TipsDialog = Vue.extend(tips);

tips.install = function (data, handleSubmit = () => {}) {
  let instance = new TipsDialog({
    data,
    propsData: {
      // 使用propsData向子组件传参，这里是关键!
      handleSubmit, //传入一个回)调函数
    },
  }).$mount();
  document.body.appendChild(instance.$el);
};

export default tips;
